﻿using il.lua;

public abstract class Statement : Expression
{
    public abstract override void Print();
}

public class ReturnExpression : Expression
{
    private readonly Expression? _result;
    public Expression? Result => _result;

    public ReturnExpression(Expression? result)
    {
        _result = result;
    }

    public override void Print()
    {
        ConsoleEx.Code("return");
        if (_result != null)
        {
            ConsoleEx.Code(" ");
            _result.Print();
        }
    }
}